<template>
  <div>
    <button @click="refresh">fdsa</button>
    <yfu-tree :param="param" v-on:nodeClick="nodeClick" v-on:nodeCheckeds="getCheckeds" ref="yfuTreeDiv"> </yfu-tree>
  </div>
</template>
<script type="text/javascript">
  import yfuTree from '@/components/common/yfuTree.vue'
  import { organizationTreeApi1 } from '@/view/api/organization.js'
  export default {
    components: {
      'yfu-tree': yfuTree
    },
    methods: {
      nodeClick (data) {
        console.log(data)
      },
      getCheckeds (data) {
        console.log('get' + data)
      },
      refresh () {
        this.$refs.yfuTreeDiv.refresh()
      }
    },
    data () {
      return {
        param: {
          defaultProps: {
            children: 'children',
            label: 'label'
          },
          showSearch: true,
          baseURL: process.env.BASE_API,
          url: organizationTreeApi1.url,
          urlParam: {
            organizationId: 1
          },
          showCheckBox: true,
          width: '90%',
          height: '400px'
        }
      }
    }
  }
</script>
<style>
</style>
